There are numerous different ways for a computer, named B, to transfer data to a computer, A. For example, if the two computers operate at different clock frequencies, they may use a FIFO (First In, First Out) buffer for the transfer. The FIFO is a holding station for the data while en route from computer B to computer A.
The FIFO may be viewed as a pipeline. Computer B, the sender, loads a sequence of data words, such as W1, followed by W2, then W3, and so on, into the pipeline. The pipeline holds the data words, and makes them available to computer A in serial fashion. Computer A, the receiver, reads data from the pipeline in the same order as they were loaded: W1 first, W2 next, and so on.
The fact that the order of reading the FIFO, by computer A, is the same as the order of loading, by computer B, gives rise to the name "First In, First Out."
Two problems arise in such an approach. First, the FIFO has a limited capacity. The sender must not attempt to load data words into a fully loaded FIFO. Second, the receiver must not attempt to read data words from an empty FIFO.
There are several approaches to solving these problems. One is to divide the data into blocks which are exactly the size of the FIFO. For example, if the FIFO holds eight words, the sender fully loads the FIFO with a burst of eight data words. Then, the sender waits an appropriate length of time, while the receiver reads the eight words. Then the sender loads another eight words.
Plainly, this approach imposes a delay on the transfer.
Another approach will be explained with reference to FIG. 1. Assume that a COUNTER produces an output which indicates the number of words presently contained in the FIFO. (FIG. 1 indicates a 74-193 COUNTER, which is commercially available.)
Before any data words are loaded into the FIFO, the counter output is set to 0000, as indicated by the sketch in the upper left quadrant of FIG. 1. Assume that the SENDER, B, places four words, W1 through W4, into the FIFO, as indicated in the upper right quadrant of FIG. 1.
As each word is loaded, the SENDER issues a pulse to the COUNT UP input of the COUNTER. Each pulse increments the COUNTER's output. The final output is 0100 (which equals 4 in decimal notation). The COUNTER's output of 0100 indicates that it contains four words.
Then the RECEIVER reads the words. As the RECEIVER reads each word, it issues a pulse to the COUNT DOWN input of the COUNTER, as shown in the lower left quadrant of the Figure. Each pulse decrements the COUNTER's output. The final output of the COUNTER is 0000, as indicated in the lower right quadrant, showing that the FIFO is empty.
A problem with this approach is that the SENDER cannot apply its COUNT UP pulse while the RECEIVER simultaneously applies its COUNT DOWN pulse. The COUNTER cannot respond to these contradictory pulses. Some arbitrator must be provided which prevents simultaneous COUNT UP and COUNT DOWN signals, thereby preventing the SENDER from loading data while the RECEIVER is reading data.